﻿using System.Collections.Generic;

namespace DraggingAndSorting.Models
{
	public interface IThingRepository
	{
		IEnumerable<SortableThing> Find();
	}

	public class ThingRepository : IThingRepository
	{
		private static readonly List<SortableThing> _things;

		static ThingRepository()
		{
			_things = new List<SortableThing>
			{
				new SortableThing{Number = 1, Text = "One", IsEven = false},
				new SortableThing{Number = 2, Text = "Two", IsEven = true},
				new SortableThing{Number = 3, Text = "Three", IsEven = false}
			};
		}

		public IEnumerable<SortableThing> Find()
		{
			return _things;
		}
	}
}